commonlibsse_ng\re\n/
NiTexture.rs1use crate::re::BSFixedString::BSFixedString;
2use crate::re::NiObject::{NiObject, NiObjectVtbl};
3use crate::re::offsets_ni_rtti::NiRTTI_NiTexture;
4use crate::re::offsets_rtti::RTTI_NiTexture;
5use crate::re::offsets_vtable::VTABLE_NiTexture;
6use crate::rel::id::VariantID;
7
8use windows::Win32::Graphics::Direct3D11::{ID3D11ShaderResourceView, ID3D11Texture2D};
9
10#[repr(C)]
11#[derive(Debug)]
12pub struct NiTexture {
13 pub __base: NiObject, pub formatPrefs: FormatPrefs, pub name: BSFixedString, pub unk28: u32, pub unk2C: u32, pub prev: *mut NiTexture, pub next: *mut NiTexture, }
21const _: () = assert!(core::mem::size_of::<NiTexture>() == 0x40);
22
23impl NiTexture {
24 pub const RTTI: VariantID = RTTI_NiTexture;
25 pub const NI_RTTI: VariantID = NiRTTI_NiTexture;
26 pub const VTABLE: [VariantID; 1] = VTABLE_NiTexture;
27}
28
29#[repr(C)]
30#[derive(Debug)]
31pub struct FormatPrefs {
32 pub pixelLayout: PixelLayout, pub alphaFormat: AlphaFormat, pub mipMapped: MipFlag, pub pad0C: u32, }
37const _: () = assert!(core::mem::size_of::<FormatPrefs>() == 0x10);
38
39#[repr(u32)]
40#[derive(Debug, Clone, Copy)]
41pub enum PixelLayout {
42 Palettized8 = 0,
43 HighColor16,
44 TrueColor32,
45 Compressed,
46 Bumpmap,
47 Palettized4,
48 Default,
49 SingleColor8,
50 SingleColor16,
51 SingleColor32,
52 DoubleColor32,
53 DoubleColor64,
54 FloatColor32,
55 FloatColor64,
56 FloatColor128,
57}
58
59#[repr(u32)]
60#[derive(Debug, Clone, Copy)]
61pub enum AlphaFormat {
62 None = 0,
63 Binary,
64 Smooth,
65 Default,
66}
67
68#[repr(u32)]
69#[derive(Debug, Clone, Copy)]
70pub enum MipFlag {
71 No = 0,
72 Yes = 1,
73 Default = 2,
74}
75
76#[repr(C)]
77#[derive(Debug)]
78pub struct RendererData {
79 pub texture: *mut ID3D11Texture2D, pub unk08: u64, pub resourceView: *mut ID3D11ShaderResourceView, pub width: u16, pub height: u16, pub unk1C: u8, pub unk1D: u8, pub unk1E: u16, pub unk20: u32, pub unk24: u32, }
90const _: () = assert!(core::mem::size_of::<RendererData>() == 0x28);
91
92#[repr(C)]
93pub struct NiTextureVtbl {
94 pub __base: NiObjectVtbl,
95
96 pub Unk25: extern "C" fn(this: *const NiTexture) -> u32, pub Unk26: extern "C" fn(this: *const NiTexture) -> u32, pub Unk27: extern "C" fn(this: *const NiTexture) -> *const u8, pub Unk28: extern "C" fn(this: *const NiTexture), pub Unk29: extern "C" fn(this: *const NiTexture) -> u32, pub Unk2A: extern "C" fn(this: *const NiTexture) -> u32, }